<template>
    <div>
        <span v-for="d in days">
          <input v-model="daysdata" type="checkbox" :value="d" >{{ d }}   |
        </span>

        <input type="button" value="测试保存的值" @click="show">
        <input type="button" value="给复选框设置状态" @click="setsetshow">
    </div>
</template>

<script setup lang="ts">
 import { ref } from 'vue';

 const daysdata=ref([])
//使用日期使用
const days=ref(["周一","周二","周三","周四","周五","周六","周日"])
    
const show=()=>{
  alert(   daysdata.value.toString())
}

const setsetshow=()=>{
    daysdata.value=["周日"]
}

</script>

<style scoped>

</style>